<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfAdoptedOperation</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinfinity-0.4 Reference Manual">
<link rel="up" href="ch03.html" title="Libinfinity's adOPTed implementation">
<link rel="prev" href="InfAdoptedRequest.html" title="InfAdoptedRequest">
<link rel="next" href="InfAdoptedNoOperation.html" title="InfAdoptedNoOperation">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="InfAdoptedRequest.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinfinity-0.4 Reference Manual</th>
<td><a accesskey="n" href="InfAdoptedNoOperation.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#InfAdoptedOperation.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#InfAdoptedOperation.description" class="shortcut">Description</a>
                   | 
                  <a href="#InfAdoptedOperation.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#InfAdoptedOperation.prerequisites" class="shortcut">Prerequisites</a>
                   | 
                  <a href="#InfAdoptedOperation.implementations" class="shortcut">Known Implementations</a>
</td></tr>
</table>
<div class="refentry" title="InfAdoptedOperation">
<a name="InfAdoptedOperation"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="InfAdoptedOperation.top_of_page"></a>InfAdoptedOperation</span></h2>
<p>InfAdoptedOperation — Operation that can be processed by
<a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" title="Stability Level">
<a name="InfAdoptedOperation.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="InfAdoptedOperation.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libinfinity/adopted/inf-adopted-operation.h&gt;

                    <a class="link" href="InfAdoptedOperation.html#InfAdoptedOperation-struct" title="InfAdoptedOperation">InfAdoptedOperation</a>;
                    <a class="link" href="InfAdoptedOperation.html#InfAdoptedOperationIface" title="InfAdoptedOperationIface">InfAdoptedOperationIface</a>;
enum                <a class="link" href="InfAdoptedOperation.html#InfAdoptedOperationFlags" title="enum InfAdoptedOperationFlags">InfAdoptedOperationFlags</a>;
enum                <a class="link" href="InfAdoptedOperation.html#InfAdoptedConcurrencyId" title="enum InfAdoptedConcurrencyId">InfAdoptedConcurrencyId</a>;
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-need-concurrency-id" title="inf_adopted_operation_need_concurrency_id ()">inf_adopted_operation_need_concurrency_id</a>
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *against</code></em>);
<a class="link" href="InfAdoptedOperation.html#InfAdoptedConcurrencyId" title="enum InfAdoptedConcurrencyId"><span class="returnvalue">InfAdoptedConcurrencyId</span></a>  <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-get-concurrency-id" title="inf_adopted_operation_get_concurrency_id ()">inf_adopted_operation_get_concurrency_id</a>
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *against</code></em>);
<a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="returnvalue">InfAdoptedOperation</span></a> * <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-transform" title="inf_adopted_operation_transform ()">inf_adopted_operation_transform</a>   (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *against</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> concurrency_id</code></em>);
<a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="returnvalue">InfAdoptedOperation</span></a> * <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-copy" title="inf_adopted_operation_copy ()">inf_adopted_operation_copy</a>        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);
<a class="link" href="InfAdoptedOperation.html#InfAdoptedOperationFlags" title="enum InfAdoptedOperationFlags"><span class="returnvalue">InfAdoptedOperationFlags</span></a>  <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-get-flags" title="inf_adopted_operation_get_flags ()">inf_adopted_operation_get_flags</a>
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-apply" title="inf_adopted_operation_apply ()">inf_adopted_operation_apply</a>         (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *by</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-is-reversible" title="inf_adopted_operation_is_reversible ()">inf_adopted_operation_is_reversible</a> (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);
<a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="returnvalue">InfAdoptedOperation</span></a> * <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-revert" title="inf_adopted_operation_revert ()">inf_adopted_operation_revert</a>      (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);
<a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="returnvalue">InfAdoptedOperation</span></a> * <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-make-reversible" title="inf_adopted_operation_make_reversible ()">inf_adopted_operation_make_reversible</a>
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *with</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="InfAdoptedOperation.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GInterface
   +----InfAdoptedOperation
</pre>
</div>
<div class="refsect1" title="Prerequisites">
<a name="InfAdoptedOperation.prerequisites"></a><h2>Prerequisites</h2>
<p>
InfAdoptedOperation requires
 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>.</p>
</div>
<div class="refsect1" title="Known Implementations">
<a name="InfAdoptedOperation.implementations"></a><h2>Known Implementations</h2>
<p>
InfAdoptedOperation is implemented by
 <a class="link" href="InfAdoptedNoOperation.html" title="InfAdoptedNoOperation">InfAdoptedNoOperation</a> and  <a class="link" href="InfAdoptedSplitOperation.html" title="InfAdoptedSplitOperation">InfAdoptedSplitOperation</a>.</p>
</div>
<div class="refsect1" title="Description">
<a name="InfAdoptedOperation.description"></a><h2>Description</h2>
<p>
The <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> interface must be implemented by operations that
are supposed to be used by <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>. They basically need to
define transformation rules for transformation against other operations.
</p>
</div>
<div class="refsect1" title="Details">
<a name="InfAdoptedOperation.details"></a><h2>Details</h2>
<div class="refsect2" title="InfAdoptedOperation">
<a name="InfAdoptedOperation-struct"></a><h3>InfAdoptedOperation</h3>
<pre class="programlisting">typedef struct _InfAdoptedOperation InfAdoptedOperation;</pre>
<p>
<a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> is an opaque data type. You should only access it
via the public API functions.
</p>
</div>
<hr>
<div class="refsect2" title="InfAdoptedOperationIface">
<a name="InfAdoptedOperationIface"></a><h3>InfAdoptedOperationIface</h3>
<pre class="programlisting">typedef struct {
  gboolean (*need_concurrency_id)(InfAdoptedOperation* operation,
                                  InfAdoptedOperation* against);

  InfAdoptedConcurrencyId (*get_concurrency_id)(InfAdoptedOperation* op,
                                                InfAdoptedOperation* against);

  InfAdoptedOperation* (*transform)(InfAdoptedOperation* operation,
                                    InfAdoptedOperation* against,
                                    InfAdoptedConcurrencyId concurrency_id);

  InfAdoptedOperation* (*copy)(InfAdoptedOperation* operation);

  InfAdoptedOperationFlags (*get_flags)(InfAdoptedOperation* operation);

  void (*apply)(InfAdoptedOperation* operation,
                InfAdoptedUser* by,
                InfBuffer* buffer);

  InfAdoptedOperation* (*revert)(InfAdoptedOperation* operation);

  InfAdoptedOperation* (*make_reversible)(InfAdoptedOperation* operation,
                                          InfAdoptedOperation* with,
                                          InfBuffer* buffer);
} InfAdoptedOperationIface;
</pre>
<p>
The virtual methods that need to be implemented by an operation to be used
with <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedOperationIface.need-concurrency-id"></a>need_concurrency_id</code></em> ()</span></p></td>
<td>Virtual function to determine whether a concurrency
ID is required to transform <em class="parameter"><code>operation</code></em> against <em class="parameter"><code>against</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedOperationIface.get-concurrency-id"></a>get_concurrency_id</code></em> ()</span></p></td>
<td>Virtual function to obtain a concurrency ID for
transforming <em class="parameter"><code>op</code></em> against <em class="parameter"><code>against</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedOperationIface.transform"></a>transform</code></em> ()</span></p></td>
<td>Virtual function that transform <em class="parameter"><code>operation</code></em> against <em class="parameter"><code>against</code></em> and
returns a new <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> as the result of the transformation.
<em class="parameter"><code>concurrency_id</code></em> is either 1 or -1 and can be used to make a decision in
case there is no other criteria to decide how to do the transformation, for
example when both <em class="parameter"><code>operation</code></em> and <em class="parameter"><code>against</code></em> are inserting text at the same
position in the buffer.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedOperationIface.copy"></a>copy</code></em> ()</span></p></td>
<td>Virtual function that returns a copy of the operation.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedOperationIface.get-flags"></a>get_flags</code></em> ()</span></p></td>
<td>Virtual function that returns the flags of the operation,
see <a class="link" href="InfAdoptedOperation.html#InfAdoptedOperationFlags" title="enum InfAdoptedOperationFlags"><span class="type">InfAdoptedOperationFlags</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedOperationIface.apply"></a>apply</code></em> ()</span></p></td>
<td>Virtual function that applies the operation to the buffer. <em class="parameter"><code>by</code></em> is
the user that applies the operation.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedOperationIface.revert"></a>revert</code></em> ()</span></p></td>
<td>Virtual function that creates a new operation that undoes the
effect of the operation. If <em class="parameter"><code>get_flags</code></em> does never return the
<a class="link" href="InfAdoptedOperation.html#INF-ADOPTED-OPERATION-REVERSIBLE:CAPS"><code class="literal">INF_ADOPTED_OPERATION_REVERSIBLE</code></a> flag set, then this is allowed to be
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfAdoptedOperationIface.make-reversible"></a>make_reversible</code></em> ()</span></p></td>
<td>Virtual function that creates a reversible operation out
of the operation itself. If <em class="parameter"><code>get_flags</code></em> does always return the
<a class="link" href="InfAdoptedOperation.html#INF-ADOPTED-OPERATION-REVERSIBLE:CAPS"><code class="literal">INF_ADOPTED_OPERATION_REVERSIBLE</code></a> flag set, then this is allowed to be
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Some operations may not be reversible, but can be made reversible
with some extra information such as another operation that collected
information while being transformed, or the current buffer. This function
should return either a new, reversible operation that has the same effect
on a buffer, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the operation cannot be made reversible.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum InfAdoptedOperationFlags">
<a name="InfAdoptedOperationFlags"></a><h3>enum InfAdoptedOperationFlags</h3>
<pre class="programlisting">typedef enum _InfAdoptedOperationFlags {
  INF_ADOPTED_OPERATION_AFFECTS_BUFFER = 1 &lt;&lt; 0,
  INF_ADOPTED_OPERATION_REVERSIBLE = 1 &lt;&lt; 1
} InfAdoptedOperationFlags;
</pre>
<p>
Various flags for <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="INF-ADOPTED-OPERATION-AFFECTS-BUFFER:CAPS"></a><span class="term"><code class="literal">INF_ADOPTED_OPERATION_AFFECTS_BUFFER</code></span></p></td>
<td>The operation changes the content of
the buffer.
</td>
</tr>
<tr>
<td><p><a name="INF-ADOPTED-OPERATION-REVERSIBLE:CAPS"></a><span class="term"><code class="literal">INF_ADOPTED_OPERATION_REVERSIBLE</code></span></p></td>
<td>The operation is reversible, which means
that <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-revert" title="inf_adopted_operation_revert ()"><code class="function">inf_adopted_operation_revert()</code></a> can be called to generate an operation
that undoes the effect of the operation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum InfAdoptedConcurrencyId">
<a name="InfAdoptedConcurrencyId"></a><h3>enum InfAdoptedConcurrencyId</h3>
<pre class="programlisting">typedef enum _InfAdoptedConcurrencyId {
  INF_ADOPTED_CONCURRENCY_SELF = 1,
  INF_ADOPTED_CONCURRENCY_NONE = 0,
  INF_ADOPTED_CONCURRENCY_OTHER = -1
} InfAdoptedConcurrencyId;
</pre>
<p>
A concurrency ID is used to determine which operation to transform in case
two similar operations are transformed against each other.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="INF-ADOPTED-CONCURRENCY-SELF:CAPS"></a><span class="term"><code class="literal">INF_ADOPTED_CONCURRENCY_SELF</code></span></p></td>
<td>Transform the operation itself.
</td>
</tr>
<tr>
<td><p><a name="INF-ADOPTED-CONCURRENCY-NONE:CAPS"></a><span class="term"><code class="literal">INF_ADOPTED_CONCURRENCY_NONE</code></span></p></td>
<td>Unspecified which operation to transform.
</td>
</tr>
<tr>
<td><p><a name="INF-ADOPTED-CONCURRENCY-OTHER:CAPS"></a><span class="term"><code class="literal">INF_ADOPTED_CONCURRENCY_OTHER</code></span></p></td>
<td>Transform the other operation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_operation_need_concurrency_id ()">
<a name="inf-adopted-operation-need-concurrency-id"></a><h3>inf_adopted_operation_need_concurrency_id ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            inf_adopted_operation_need_concurrency_id
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *against</code></em>);</pre>
<p>
This function returns whether transforming <em class="parameter"><code>operation</code></em> against <em class="parameter"><code>against</code></em>
is not defined unambiguously. In that case, transformation requires a
so-called concurrency ID which determines which of the two operations
is transformed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> to transform.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>against</code></em> :</span></p></td>
<td>The operation to transform against.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Whether transformation of <em class="parameter"><code>operation</code></em> against <em class="parameter"><code>against</code></em> requires a
concurrency ID to be defined.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_operation_get_concurrency_id ()">
<a name="inf-adopted-operation-get-concurrency-id"></a><h3>inf_adopted_operation_get_concurrency_id ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedOperation.html#InfAdoptedConcurrencyId" title="enum InfAdoptedConcurrencyId"><span class="returnvalue">InfAdoptedConcurrencyId</span></a>  inf_adopted_operation_get_concurrency_id
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *against</code></em>);</pre>
<p>
This function returns a concurrency ID for transformation of <em class="parameter"><code>operation</code></em>
against <em class="parameter"><code>against</code></em>. It always returns <a class="link" href="InfAdoptedOperation.html#INF-ADOPTED-CONCURRENCY-NONE:CAPS"><code class="literal">INF_ADOPTED_CONCURRENCY_NONE</code></a> when
<a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-need-concurrency-id" title="inf_adopted_operation_need_concurrency_id ()"><code class="function">inf_adopted_operation_need_concurrency_id()</code></a> returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> for
<em class="parameter"><code>operation</code></em> and <em class="parameter"><code>against</code></em> (but that's not necessarily true the other way
around), since it is not possible to decide which operation to transform
without any additional information.
</p>
<p>
However, the function can be called on the same operations in a previous
state. In some cases, a decision can be made based on those previous
operations. This can then be used as concurrency ID to call
<a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-transform" title="inf_adopted_operation_transform ()"><code class="function">inf_adopted_operation_transform()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> to transform.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>against</code></em> :</span></p></td>
<td>The operation to transform against.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A concurrency ID between <em class="parameter"><code>operation</code></em> and <em class="parameter"><code>against</code></em>. Can be
<a class="link" href="InfAdoptedOperation.html#INF-ADOPTED-CONCURRENCY-NONE:CAPS"><code class="literal">INF_ADOPTED_CONCURRENCY_NONE</code></a> in case no decision can be made.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_operation_transform ()">
<a name="inf-adopted-operation-transform"></a><h3>inf_adopted_operation_transform ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="returnvalue">InfAdoptedOperation</span></a> * inf_adopted_operation_transform   (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *against</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> concurrency_id</code></em>);</pre>
<p>
Performs an inclusion transformation of <em class="parameter"><code>operation</code></em> against <em class="parameter"><code>against</code></em>,
meaning that the effect of <em class="parameter"><code>against</code></em> is included in <em class="parameter"><code>operation</code></em>.
</p>
<p>
If <a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-need-concurrency-id" title="inf_adopted_operation_need_concurrency_id ()"><code class="function">inf_adopted_operation_need_concurrency_id()</code></a> returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> for <em class="parameter"><code>operation</code></em>
and <em class="parameter"><code>against</code></em>, then <em class="parameter"><code>concurrency_id</code></em> must not be
<a class="link" href="InfAdoptedOperation.html#INF-ADOPTED-CONCURRENCY-NONE:CAPS"><code class="literal">INF_ADOPTED_CONCURRENCY_NONE</code></a>. Otherwise, the parameter is ignored.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> to transform.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>against</code></em> :</span></p></td>
<td>The operation to transform against.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>concurrency_id</code></em> :</span></p></td>
<td>The concurrency ID for the transformation.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The transformed <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the
transformation failed.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_operation_copy ()">
<a name="inf-adopted-operation-copy"></a><h3>inf_adopted_operation_copy ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="returnvalue">InfAdoptedOperation</span></a> * inf_adopted_operation_copy        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);</pre>
<p>
Returns a copy of <em class="parameter"><code>operation</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>The <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> to copy.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A copy of <em class="parameter"><code>operation</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_operation_get_flags ()">
<a name="inf-adopted-operation-get-flags"></a><h3>inf_adopted_operation_get_flags ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedOperation.html#InfAdoptedOperationFlags" title="enum InfAdoptedOperationFlags"><span class="returnvalue">InfAdoptedOperationFlags</span></a>  inf_adopted_operation_get_flags
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);</pre>
<p>
Returns the flags for <em class="parameter"><code>operation</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a class="link" href="InfAdoptedOperation.html#InfAdoptedOperationFlags" title="enum InfAdoptedOperationFlags"><span class="type">InfAdoptedOperationFlags</span></a> for <em class="parameter"><code>operation</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_operation_apply ()">
<a name="inf-adopted-operation-apply"></a><h3>inf_adopted_operation_apply ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_adopted_operation_apply         (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a> *by</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>);</pre>
<p>
Applies <em class="parameter"><code>operation</code></em> to <em class="parameter"><code>buffer</code></em>. The operation is considered to be applied by
user <em class="parameter"><code>by</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>by</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedUser.html" title="InfAdoptedUser"><span class="type">InfAdoptedUser</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>The <a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> to apply the operation to.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_operation_is_reversible ()">
<a name="inf-adopted-operation-is-reversible"></a><h3>inf_adopted_operation_is_reversible ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            inf_adopted_operation_is_reversible (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);</pre>
<p>
Returns whether <em class="parameter"><code>operation</code></em> is reversible.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Whether <em class="parameter"><code>operation</code></em> is reversible.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_operation_revert ()">
<a name="inf-adopted-operation-revert"></a><h3>inf_adopted_operation_revert ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="returnvalue">InfAdoptedOperation</span></a> * inf_adopted_operation_revert      (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>);</pre>
<p>
Returns a new <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> that undoes the effect of <em class="parameter"><code>operation</code></em>. If
<em class="parameter"><code>operation</code></em> and then its reverse operation are applied to a buffer (in that
order), the buffer remains unchanged.
</p>
<p>
<em class="parameter"><code>operation</code></em> must be reversible for this function to be called (i.e.
<a class="link" href="InfAdoptedOperation.html#inf-adopted-operation-is-reversible" title="inf_adopted_operation_is_reversible ()"><code class="function">inf_adopted_operation_is_reversible()</code></a> must return TRUE).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The reverse operation of <em class="parameter"><code>operation</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_adopted_operation_make_reversible ()">
<a name="inf-adopted-operation-make-reversible"></a><h3>inf_adopted_operation_make_reversible ()</h3>
<pre class="programlisting"><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="returnvalue">InfAdoptedOperation</span></a> * inf_adopted_operation_make_reversible
                                                        (<em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *operation</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> *with</code></em>,
                                                         <em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>);</pre>
<p>
Some operations may not be reversible, but can be made reversible with
some extra information such as another operation that collected
enough information while being transformed, and the current buffer.
</p>
<p>
This function can only be called when <em class="parameter"><code>operation</code></em> is not yet reversible
and returns a new operation that has the same effect as <em class="parameter"><code>operation</code></em>, but is
reversible.
</p>
<p>
For example, an operation that deletes some range of text in a text editor
is not reversible if it only stores the position and length of the range,
but can be made reversible when it looks up what there is at that position
in the buffer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>operation</code></em> :</span></p></td>
<td>A <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>with</code></em> :</span></p></td>
<td>Another <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a> that emerged from <em class="parameter"><code>operation</code></em> by
transforming it.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A reversible <a class="link" href="InfAdoptedOperation.html" title="InfAdoptedOperation"><span class="type">InfAdoptedOperation</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>operation</code></em>
cannot be made reversible with the given transformed operation <em class="parameter"><code>with</code></em> and
<em class="parameter"><code>buffer</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="InfAdoptedOperation.see-also"></a><h2>See Also</h2>
<a class="link" href="InfAdoptedRequest.html" title="InfAdoptedRequest"><span class="type">InfAdoptedRequest</span></a>, <a class="link" href="InfAdoptedAlgorithm.html" title="InfAdoptedAlgorithm"><span class="type">InfAdoptedAlgorithm</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>